package students_files_test01;

public class OrderItem {
    private Product product;
    private int quantity;

    public OrderItem(Product initialProduct,int initialQuantity){
        this.product = initialProduct;
        this.quantity = initialQuantity;
    }

    public Product getProduct() {
        return product;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public double getValue(){
        return this.product.getPrice()*this.quantity;
    }

    public String toString(){
        return this.quantity + this.product.getCode() + "-" + this.product.getPrice();
    }
}
